﻿define(['backbone'], function (Backbone) {

    // 使用Backbone实现路由
    var Router = Backbone.Router.extend({
        routes: {
            '': 'homeFunc',
            'home': 'homeFunc',
            'sscs':'sscsFunc',
            'shoppingCar':'carFunc',
            'mine':'mineFunc'
        },
        homeFunc: function () {
            require(['home/js/home'], function (Home) {
                Home.init();
            })
        },
        sscsFunc: function () {
            require(['sscs/js/sscs'], function (Sscs) {
                Sscs.init();
            });
        },
        carFunc: function () {
            require(['shoppingCar/js/shoppingCar'], function (Car) {
               Car.init();
            });
        },
        mineFunc: function () {
            require(['mine/js/mine'], function (Mine) {
               Mine.init();
            });
        }
     

    });
    new Router();
    Backbone.history.start();

});